<template>
  <div class="app-container">
    <aside style="margin-top:15px;">
      Here we use window.print() to implement the feature of downloading PDF.
    </aside>
    <router-link target="_blank" to="/pdf/download">
      <el-button type="primary">
        Click to download PDF
      </el-button>
    </router-link>
    <h1>C3D</h1>

    <div>
      <router-link :to="{path:'/iframe-page',query:{iframeId:iframeId}}">打开新页面</router-link>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
      article: '',
      fullscreenLoading: true,
      iframeId: '20230803121650'
    }
  },
  mounted() {
    console.info('mounted')
    // console.info('当前设备类型：', this.detectDeviceType())
  },
  methods: {
    test() {
      console.info(1)
    }
    // detectDeviceType() {
    //   const isIPad = () => {
    //     const userAgent = navigator.userAgent
    //     return /iPad/i.test(userAgent)
    //   }
    //
    //   const isAndroid = () => {
    //     const userAgent = navigator.userAgent
    //     return /Android/i.test(userAgent)
    //   }
    //
    //   const isWindows = () => {
    //     const userAgent = navigator.userAgent
    //     return /Windows/i.test(userAgent)
    //   }
    //
    //   const isDeviceWithScreenSize = (minWidth, maxWidth, minHeight, maxHeight) => {
    //     const screenWidth = window.screen.width
    //     const screenHeight = window.screen.height
    //
    //     return (
    //       screenWidth >= minWidth &&
    //       screenWidth <= maxWidth &&
    //       screenHeight >= minHeight &&
    //       screenHeight <= maxHeight
    //     )
    //   }
    //
    //   let deviceType = 'Unknown'
    //
    //   if (isIPad()) {
    //     deviceType = 'iPad'
    //   } else if (isAndroid()) {
    //     deviceType = 'Android'
    //   } else if (isWindows()) {
    //     deviceType = 'Windows'
    //   } else if (
    //     isDeviceWithScreenSize(768, 1024, 1024, 1366) // iPad typical screen size
    //   ) {
    //     deviceType = 'iPad (Fallback)'
    //   } else {
    //     deviceType = 'Unknown'
    //   }
    //   return deviceType
    // }
  }
}
</script>
